(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/components/lottie-view/index" ], {
    "2d57": function(t, e, n) {
        n.r(e);
        var a = n("e62c"), o = n("7d29");
        for (var i in o) [ "default" ].indexOf(i) < 0 && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(i);
        n("b68a");
        var r = n("f0c5"), c = Object(r.a)(o.default, a.b, a.c, !1, null, "2d8f0326", null, !1, a.a, void 0);
        e.default = c.exports;
    },
    7369: function(t, e, n) {
        (function(t) {
            var a = n("4ea4");
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var o = a(n("2eee")), i = a(n("c973")), r = a(n("75b0")), c = n("12b1");
            e.default = {
                name: "LottieView",
                props: {
                    keyName: String,
                    animations: Object,
                    width: [ String, Number ],
                    height: [ String, Number ]
                },
                computed: {
                    keyRand: function() {
                        return "".concat(this.keyName, "_").concat(Date.now());
                    },
                    canvasStyle: function() {
                        var t = {};
                        return this.width && (t.width = "".concat(this.width, "rpx")), this.height && (t.height = "".concat(this.height, "rpx")), 
                        t;
                    }
                },
                mounted: function() {
                    var t = this;
                    this.$nextTick(function() {
                        t.loadData();
                    });
                },
                beforeDestroy: function() {
                    console.log("destroy"), this.destoryAni();
                },
                methods: {
                    initAni: function() {
                        var e = this;
                        if (console.log("inited"), !this._inited) try {
                            t.createSelectorQuery().in(this).selectAll("#lottieCanvas_".concat(this.keyRand)).node(function(t) {
                                try {
                                    var n = t[0].node;
                                    if (!n) return console.warn("未获取到canvas节点"), void e.$emit("LoadError");
                                    e.canvasContext = n.getContext("2d"), n.width = e.width, n.height = e.height, r.default.setup(n), 
                                    e.$emit("init"), e._inited = !0;
                                } catch (t) {
                                    t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
                                    console.warn("lottie初始化失败inner", t), e.$emit("LoadError"), e.lottieCanvas = null;
                                }
                            }).exec();
                        } catch (t) {
                            t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
                            console.warn("lottie初始化失败", t), this.$emit("LoadError"), this.lottieCanvas = null;
                        }
                    },
                    loadData: function() {
                        var t = this;
                        return (0, i.default)(o.default.mark(function e() {
                            var n, a;
                            return o.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    e.t0 = o.default.keys(t.animations);

                                  case 1:
                                    if ((e.t1 = e.t0()).done) {
                                        e.next = 9;
                                        break;
                                    }
                                    if (n = e.t1.value, !Object.hasOwnProperty.call(t.animations, n)) {
                                        e.next = 7;
                                        break;
                                    }
                                    return a = t.animations[n], e.next = 7, (0, c.downloadAndSaveToStorage)(n, a);

                                  case 7:
                                    e.next = 1;
                                    break;

                                  case 9:
                                    t.initAni();

                                  case 10:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    stopAni: function() {
                        this.lottieCanvas && this.lottieCanvas.stop();
                    },
                    destoryAni: function() {
                        this.lottieCanvas && (this.lottieCanvas.stop(), this.lottieCanvas.destroy(), this.lottieCanvas = null);
                    },
                    play: function(t, e) {
                        var n = this;
                        return (0, i.default)(o.default.mark(function a() {
                            var i, s;
                            return o.default.wrap(function(a) {
                                for (;;) switch (a.prev = a.next) {
                                  case 0:
                                    if (!n.animations.hasOwnProperty(t)) {
                                        a.next = 17;
                                        break;
                                    }
                                    return a.prev = 1, a.next = 4, (0, c.downloadAndSaveToStorage)(t, n.animations[t]);

                                  case 4:
                                    i = a.sent, s = i.data, n.destoryAni(), n.lottieCanvas = r.default.loadAnimation({
                                        loop: e,
                                        autoplay: !0,
                                        animationData: s,
                                        rendererSettings: {
                                            context: n.canvasContext,
                                            preserveAspectRatio: "xMidYMax meet"
                                        }
                                    }), n.lottieCanvas.addEventListener("complete", function() {
                                        n.$emit("lottieEvent", "complete", t);
                                    }), n.$emit("lottieEvent", "play", t), a.next = 15;
                                    break;

                                  case 12:
                                    a.prev = 12, a.t0 = a.catch(1), console.warn("动画播放失败", a.t0);

                                  case 15:
                                    a.next = 18;
                                    break;

                                  case 17:
                                    console.warn("未找到动画".concat(t));

                                  case 18:
                                  case "end":
                                    return a.stop();
                                }
                            }, a, null, [ [ 1, 12 ] ]);
                        }))();
                    }
                }
            };
        }).call(this, n("543d").default);
    },
    "7d29": function(t, e, n) {
        n.r(e);
        var a = n("7369"), o = n.n(a);
        for (var i in a) [ "default" ].indexOf(i) < 0 && function(t) {
            n.d(e, t, function() {
                return a[t];
            });
        }(i);
        e.default = o.a;
    },
    a0a7: function(t, e, n) {},
    b68a: function(t, e, n) {
        var a = n("a0a7");
        n.n(a).a;
    },
    e62c: function(t, e, n) {
        n.d(e, "b", function() {
            return a;
        }), n.d(e, "c", function() {
            return o;
        }), n.d(e, "a", function() {});
        var a = function() {
            var t = this, e = (t.$createElement, t._self._c, t.__get_style([ t.canvasStyle ]));
            t.$mp.data = Object.assign({}, {
                $root: {
                    s0: e
                }
            });
        }, o = [];
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "pages/components/lottie-view/index-create-component", {
    "pages/components/lottie-view/index-create-component": function(t, e, n) {
        n("543d").createComponent(n("2d57"));
    }
}, [ [ "pages/components/lottie-view/index-create-component" ] ] ]);